<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../common/base_body_header.jsp" %>
<%@include file="../../common/navbar.jsp" %>
<%@include file="../../common/page_content_pre.jsp" %>
<style>
 .con-mid{
    padding-right: 20px;
    background-color: whitesmoke;
    font-size:14px;
  }
  .itemList1{
    margin: 1px auto;
    width: 500px;
    padding: 25px 1px;
    padding-bottom:20px;
  }
 .proInfo1{
    padding-left: 10px;
  }
  .proInfo1 .info{
    list-style: none;
    float: left;
    width: 100%;
    height: 35px;
  }
</style>
<div class="page-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="widget-box">
                <div class="widget-header">
                    <h4>用户详情</h4>
                </div>

                <div class="widget-body">
                    <div class="widget-main no-padding">
                       <div class="con-mid" style="height:200px;">
						    <div class="itemList1">
                             <ul class="proInfo1">
						        <li class="info">用户姓名：${sysUser.username}</li>
						        <li class="info">手机号码：${sysUser.account}</li>
						        <li class="info">首单时间：${sysUser.orderFstDate}</li>
						        <li class="info">地址： ${sysUser.address} </li>
						        <li class="info">推荐人： 
						           <c:if test="${not empty pName}">${pName}</c:if>
						            <c:if test="${empty pName}">无</c:if>
						        </li>
						    </ul>
						  </div>
						  <button class="btn btn-sm btn-info" onclick="updateUser(${sysUser.userId})">修改个人信息 </button>
                    </div>
                </div>
            </div>

           <c:if test="${not empty sysUser.salesperson}">
            <div class="widget-box">
                <div class="widget-header">
                    <h4>销售顾问信息</h4>
                </div>
                <div class="widget-body">
                    <div class="widget-main no-padding">
	                    <div class="con-mid" style="height:110px;">
							    <div class="itemList1">
	                             <ul class="proInfo1">
							        <li class="info">销售姓名：${salespersonName}</li>
							        <li class="info">手机号码：${salespersonPhone}</li>
							    </ul>
							  </div>
							  <button class="btn btn-sm btn-info" onclick="updateDistributor(${sysUser.salesperson})">查看销售信息</button>
	                    </div>
                    </div>
                </div>
            </div>
			</c:if>
			
            <div class="widget-box">
                <div class="widget-header">
                    <h4>订单信息</h4>
                </div>

                <div class="widget-body">
                    <div class="widget-main no-padding">
                        <div class="con-mid" style="height:110px;">
							    <div class="itemList1">
	                             <ul class="proInfo1">
							        <li class="info">订单总数： ${orderInfo.orderCount}单</li>
							        <li class="info">总购买金额： ${orderInfo.tallPrice}元</li>
							    </ul>
							  </div>
							  <button class="btn btn-sm btn-info" onclick="orderList(${sysUser.userId})"> 订单记录 </button>
	                    </div>
                    </div>
                </div>
            </div>

            <div class="widget-box">
                <div class="widget-header">
                    <h4>积分信息</h4>
                </div>

                <div class="widget-body">
                    <div class="widget-main no-padding">
                         <div class="con-mid" style="height:140px;">
							    <div class="itemList1">
	                             <ul class="proInfo1">
							        <li class="info">总积分： ${integral.tallIntegral}</li>
							        <li class="info">已消费： ${integral.usedIntegral}</li>
							        <li class="info">可用积分： ${integral.surplusIntegral}</li>
							    </ul>
							  </div>
							  <button class="btn btn-sm btn-info" onclick="integral(${sysUser.userId})">积分记录</button>
	                    </div>
                    </div>
                </div>

                <div class="widget-box">
                    <div class="widget-header">
                        <h4>推荐币信息</h4>
                    </div>
                    <div class="widget-body">
                        <div class="widget-main no-padding">
	                         <div class="con-mid" style="height:140px;">
								    <div class="itemList1">
		                             <ul class="proInfo1">
								        <li class="info">推荐币总数量： ${integral2.tallIntegral}</li>
								        <li class="info">已消费数量： ${integral2.usedIntegral}</li>
								        <li class="info">可用数量：  ${integral2.surplusIntegral}</li>
								    </ul>
								  </div>
								  <button class="btn btn-sm btn-info" onclick="changeRecord(${sysUser.userId})">推荐币记录</button>
		                     </div>
                        </div>
                    </div>
                </div>

                <div class="widget-box">
                    <div class="widget-header">
                        <h4>礼品券信息</h4>
                    </div>
                    <div class="widget-body">
                        <div class="widget-main no-padding">
                           <div class="con-mid" style="height:140px;">
								    <div class="itemList1">
		                             <ul class="proInfo1">
								        <li class="info">总礼品券： ${rewardTicket.tallCount}张</li>
								        <li class="info">已使用： ${rewardTicket.usedCount}张</li>
								        <li class="info">可用礼金券： ${rewardTicket.notUsedCount}张</li>
								    </ul>
								  </div>
								  <button class="btn btn-sm btn-info" onclick="rewardTicket(${sysUser.account})">礼品券记录</button>
		                     </div>
                        </div>
                    </div>
                </div>

                <div class="widget-box">
                    <div class="widget-header">
                        <h4>送礼信息</h4>
                    </div>

                    <div class="widget-body">
                        <div class="widget-main no-padding">
                           <div class="con-mid" style="height:110px;">
								    <div class="itemList1">
		                             <ul class="proInfo1">
								        <li class="info">送出： ${giftRecord.getOutCount}</li>
								        <li class="info">接收：${giftRecord.getInCount}</li>
								    </ul>
								  </div>
								  <button class="btn btn-sm btn-info" onclick="giftRecord(${sysUser.userId})">送礼记录</button>
		                     </div>
                        </div>
                    </div>
                </div>
                
                
                <div class="form-actions center">
                               <button type="button" class="btn btn-sm btn-grey" style="margin-right:30px;" onclick="goBack();return false;"> 返回
                                    <i class="icon-reply icon-on-right bigger-110"></i>
                                </button>      
               </div>
                            
        </div>
    </div>
</div>

<%@include file="../../common/page_content_suf.jsp" %>
<%@include file="../../common/script.jsp" %>

<script type="text/javascript">
	var goBack = function () {
	    document.location.href = "${GLOBAL.basePath}/sysuser";
	};
    function updateUser(userId) {
        document.location.href = "${GLOBAL.basePath}/sysuser/modify?userId=" + userId;
    }

    function updateDistributor(userId) {
        document.location.href = "${GLOBAL.basePath}/distributor/detail?userId=" + userId;
    }
    //订单
    function orderList(userId) {
        document.location.href = "${GLOBAL.basePath}/orderManagement/list";
    }
    //积分
    function integral(userId){
        document.location.href = "${GLOBAL.basePath}/integral/list?userId=" + userId;
    }
    //推荐币
    function changeRecord(userId){
    	document.location.href = "${GLOBAL.basePath}/integral/list2?userId=" + userId;
    }
    //礼品券
    function rewardTicket(phone){
        document.location.href = "${GLOBAL.basePath}/rewardRecord/list?ownerUserPhone="+phone;
    }
    //送礼
    function giftRecord(userId) {
        document.location.href = "${GLOBAL.basePath}/giftGivingRecord/list";
    }

</script>
